<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite">

<composite:interface>
    <composite:attribute name="trackingResponses" required="true"/>
    <composite:attribute name="procInstId" required="true"/>
</composite:interface>

<composite:implementation>
    <p:dialog id="workflowTrackingDialog" widgetVar="workflowTrackingDialogWidgetVar" modal="true" header="流程跟踪"
              resizable="false" width="1200" height="400">
        <div class="ui-g ui-fluid">
            <div class="ui-g-12 card">
                <div class="ui-g-12"><h3><b>流程跟踪图</b></h3></div>
                <p:graphicImage value="#{workflowImageBean.workflowTrackingImage}">
                    <f:param name="procInstId" value="#{cc.attrs.procInstId}"/>
                </p:graphicImage>

                <div class="ui-g-12"><h3><b>流程详情列表</b></h3></div>
                <p:dataTable
                        value="#{cc.attrs.trackingResponses}"
                        style="width: 100%"
                        var="tracking"
                        emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                        reflow="true"
                        resizableColumns="true">

                    <p:column headerText="审批节点">
                        <h:outputText value="#{tracking.activityName}"/>
                    </p:column>
                    <p:column headerText="审批结果">
                        <h:outputText value="#{tracking.operateType.label}"/>
                    </p:column>
                    <p:column headerText="审批人角色">
                        <h:outputText value="#{tracking.roleName}"/>
                    </p:column>
                    <p:column headerText="审批人">
                        <h:outputText value="#{tracking.assigneeName}"/>
                    </p:column>
                    <p:column headerText="审批意见">
                        <h:outputText value="#{tracking.opinion}"/>
                    </p:column>
                    <p:column headerText="审批备注">
                        <h:outputText value="#{tracking.remark}"/>
                    </p:column>
                    <p:column headerText="审批开始时间">
                        <h:outputText value="#{tracking.startTime}">
                            <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="审批结束时间">
                        <h:outputText value="#{tracking.endTime}">
                            <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="耗时">
                        <h:outputText value="#{tracking.durationDisplay}"/>
                    </p:column>
                </p:dataTable>
            </div>
        </div>
    </p:dialog>

</composite:implementation>
</html>